package com.xcenter.cabinet.util;

import com.xcenter.cabinet.util.key.SnowflakeIdWorker;

public class SimpleIdUtil {
	
	/**
	 * 生成Id
	 * @return
	 */
	public static Long genId() {
		return genIds(1)[0];
	}
	
	/**
	 * 批量生成Id
	 * @return
	 */
	public static Long[] genIds(int count) {
		Long[] ids = new Long[count];
		SnowflakeIdWorker idWorker0 = new SnowflakeIdWorker(0, 0);
		for (int i = 0; i < count; i++) {
			ids[i] = idWorker0.nextId();
		}
		return ids;
	}

}
